package cn.mymall.service.impl;

import cn.mymall.entity.MemberAddress;
import cn.mymall.mapper.MemberAddressMapper;
import cn.mymall.service.IMemberAddressService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liqilun
 * @since 2024-03-23
 */
@Service
public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, MemberAddress> implements IMemberAddressService {

    @Override
    public MemberAddress getDefaultAddress(Integer memberId) {
        return getOne(new QueryWrapper<MemberAddress>().eq("member_id", memberId).eq("default_address", "Y"));
    }
}
